<#assign p = p!0>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <#include "/common/common_head.ftl">
  </head>

  <body style="padding-top:0px;">

 		<!-- 主内容区域 S -->
 		<div class="" id="mainBoard">
		<!-- 导航路径 S -->
		<ol class="breadcrumb">
		  <li><a href="#">菜单管理</a></li>
		  <li class="active">添加菜单</li>
		</ol>
		<!-- 导航路径 E -->

		<!-- 标题区 S -->
		<h2 class="sub-header">添加菜单项</h2>
		<!-- 标题区 E -->

		<!-- 内容区 S -->
        <#if menu??>
		<form action="saveMenu.do" method="post">
		    <div class="input-group">
              <span class="input-group-addon" id="basic-addon1">菜单编号</span>
              <input type="text" class="form-control" placeholder="ID" aria-describedby="basic-addon1" name="id" value="${menu.id?if_exists}">
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon2">菜单名称</span>
              <input type="text" class="form-control" placeholder="name" aria-describedby="basic-addon2" name="name" value="${menu.name?if_exists}">
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon3">功能入口</span>
              <input type="text" class="form-control" placeholder="jurl" aria-describedby="basic-addon3" name="jurl" value="${menu.jurl?if_exists}">
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon5">父级菜单</span>
              <select class="form-control" name="pid">
                <option value="-1">顶级菜单</option>
                <#if menuPool??>
                    <#list menuPool as m>
                        <option value="${m.id?if_exists}" <#if m.id == menu.pid>selected</#if>>|--- ${m.name?if_exists}</option>
                        <#list m.children as sub>
                            <option value="${sub.id?if_exists}"  <#if sub.id == menu.pid>selected</#if>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|--- ${sub.name?if_exists}</option>
                        </#list>
                    </#list>
                </#if>
              </select>
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon5">隐藏属性</span>
              <select class="form-control" name="hidden">
                <option value="0" <#if menu.hidden == 0>selected</#if>>正常</option>
                <option value="1" <#if menu.hidden == 1>selected</#if>>隐藏</option>
              </select>
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon6">描述信息</span>
              <input type="text" class="form-control" placeholder="description" aria-describedby="basic-addon6" name="description" value="${menu.description?if_exists}">
            </div>

            <button type="submit" class="btn btn-default">Submit</button>

		</form>
        <#else>
		<form action="saveMenu.do" method="post">
		    <div class="input-group">
              <span class="input-group-addon" id="basic-addon1">菜单编号</span>
              <input type="text" class="form-control" placeholder="ID" aria-describedby="basic-addon1" >
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon2">菜单名称</span>
              <input type="text" class="form-control" placeholder="name" aria-describedby="basic-addon2" name="name">
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon3">功能入口</span>
              <input type="text" class="form-control" placeholder="jurl" aria-describedby="basic-addon3" name="jurl">
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon5">父级菜单</span>
              <select class="form-control" name="pid">
                <option value="-1">顶级菜单</option>
                <#if menuPool??>
                    <#list menuPool as m>
                        <option value="${m.id?if_exists}">|--- ${m.name?if_exists}</option>
                        <#list m.children as sub>
                            <option value="${sub.id?if_exists}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|--- ${sub.name?if_exists}</option>
                        </#list>
                    </#list>
                </#if>
              </select>
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon5">隐藏属性</span>
              <select class="form-control" name="hidden">
                <option value="0">正常</option>
                <option value="1">隐藏</option>
              </select>
            </div>

            <div class="input-group">
              <span class="input-group-addon" id="basic-addon6">描述信息</span>
              <input type="text" class="form-control" placeholder="description" aria-describedby="basic-addon6" name="description">
            </div>

            <button type="submit" class="btn btn-default">Submit</button>

		</form>
        </#if>
		<!-- 内容区 E -->
 		<!-- 主内容区域 E -->

  </body>
</html>
